From: Bilal Elmoussaoui Date: Tue, 14 Apr 2026 17:37:51 +0000 (+0200) Subject: Use g_clear_list macros X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~10^2^2~52 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=d709f2f954b03e91980b021dca64f7ada31efb84;p=gnome-shell.git Use g_clear_list macros Part-of: --- diff --git a/src/shell-app.c b/src/shell-app.c index 34f75c185..ed7ecfffe 100644 --- a/src/shell-app.c +++ b/src/shell-app.c @@ -333,8 +333,7 @@ find_most_recent_transient_on_same_workspace (MetaDisplay *display, * returned from the sort_windows_by_stacking function) */ transients_sorted = g_slist_reverse (transients_sorted); - g_slist_free (transients); - transients = NULL; + g_clear_slist (&transients, NULL); result = NULL; for (iter = transients_sorted; iter; iter = iter->next) diff --git a/src/st/croco/cr-parser.c b/src/st/croco/cr-parser.c index 4abf3b907..864e287e7 100644 --- a/src/st/croco/cr-parser.c +++ b/src/st/croco/cr-parser.c @@ -2474,8 +2474,7 @@ cr_parser_parse_stylesheet (CRParser * a_this) } } - g_list_free (media_list); - media_list = NULL; + g_clear_list (&media_list, NULL); } if (import_string) { @@ -3665,8 +3664,7 @@ cr_parser_parse_import (CRParser * a_this, } } - g_list_free (*a_media_list); - *a_media_list = NULL; + g_clear_list (&*a_media_list, NULL); } if (*a_import_string) { @@ -3818,8 +3816,7 @@ cr_parser_parse_media (CRParser * a_this) cr_string_destroy (cur->data); } - g_list_free (media_list); - media_list = NULL; + g_clear_list (&media_list, NULL); } cr_parser_clear_errors (a_this); @@ -3846,8 +3843,7 @@ cr_parser_parse_media (CRParser * a_this) cr_string_destroy (cur->data); } - g_list_free (media_list); - media_list = NULL; + g_clear_list (&media_list, NULL); } cr_tknzr_set_cur_pos (PRIVATE (a_this)->tknzr, &init_pos); diff --git a/src/st/croco/cr-statement.c b/src/st/croco/cr-statement.c index 778354516..45e305e58 100644 --- a/src/st/croco/cr-statement.c +++ b/src/st/croco/cr-statement.c @@ -513,8 +513,7 @@ cr_statement_clear (CRStatement * a_this) } } - g_list_free (a_this->kind.media_rule->media_list); - a_this->kind.media_rule->media_list = NULL; + g_clear_list (&a_this->kind.media_rule->media_list, NULL); } g_free (a_this->kind.media_rule); a_this->kind.media_rule = NULL; @@ -1403,8 +1402,7 @@ cr_statement_at_import_rule_parse_from_buf (const guchar * a_buf, media_list->data = NULL; } } - g_list_free (media_list); - media_list = NULL; + g_clear_list (&media_list, NULL); } if (import_string) { cr_string_destroy (import_string); diff --git a/src/st/st-theme.c b/src/st/st-theme.c index afff58db1..1b55015cd 100644 --- a/src/st/st-theme.c +++ b/src/st/st-theme.c @@ -387,8 +387,7 @@ st_theme_finalize (GObject * object) StTheme *theme = ST_THEME (object); g_slist_foreach (theme->custom_stylesheets, (GFunc) cr_stylesheet_unref, NULL); - g_slist_free (theme->custom_stylesheets); - theme->custom_stylesheets = NULL; + g_clear_slist (&theme->custom_stylesheets, NULL); g_hash_table_destroy (theme->stylesheets_by_file); g_hash_table_destroy (theme->files_by_stylesheet);